import { $get, $delete } from '@js/request';
import { VideoCourtSchema } from '@src/components/schema/videoCourt';

export async function getListRequest (data: { [k: string]: any }): Promise<{ list: VideoCourtSchema[], total: number }> {
  const res = await $get('/api/commission/meeting/records', data)
  return res.data
}

export async function delRequest (id: string): Promise<void> {
  const res = await $delete('/api/commission//meeting/records', {
    conf_uuids: id
  })
  return res.data
}

export interface ResourceSchema {
  activeAttendeeCount: number
  confCount: number
  confLength: number
  sumCount: number
  totalAttendeeCount: number
  usedRecStorage: number
}

export async function getResourceRequest (): Promise<ResourceSchema> {
  const res = await $get('/api/commission/meeting/resourceInfo')
  return res.data
}
